<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<html>
<head>
<title>Message List</title>
  <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style.css"/>" />
 
</head>
<body>
<security:authorize ifAllGranted="ROLE_ADMIN">Hello adminS</security:authorize>
<br/>
Handling time : ${handlingTime} ms 
<br/>
Locale : ${pageContext.response.locale}
<br/>

	<c:forEach items="${messages}" var="message">
		<table>
			<tr>
				<td>Author</td>
				<td>${message.author}</td>
			</tr>
			<tr>
				<td>Title</td>
				<td>${message.title}</td>
			</tr>
			<tr>
				<td>Body</td>
				<td>${message.body}</td>
			</tr>
			<tr>
				<td colspan="2"><a href="messageDelete?messageId=${message.id}">Delete</a>
				</td>
			</tr>
		</table>
		<hr />
	</c:forEach>
	<a href="messagePost">Post</a>
	
	<br/><br/>
	<a href="<c:url value="/login.jsp" />">Login</a><br/>
	<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
</body>
</html>